// 导入请求模块
import servers from '@/utils/servers'

// 获取用户请求
export const getUserData = () => {
  return servers({
    method: 'GET',
    url: '/v1_0/user'
    // headers: { // 请求头
    //   Authorization: `Bearer ${token}`
    // }
  })
}
// 首页----------------------------------------------
// 首页频道列表
export const homeStatus = () => {
  return servers({
    method: 'GET',
    url: '/v1_0/user/channels'
  })
}
// 文章频道列表
export const articleList = (params) => {
  return servers({
    method: 'GET',
    url: '/v1_0/articles',
    params
  })
}
// 用户推荐频道列表
export const homeAllStatus = () => {
  return servers({
    method: 'GET',
    url: '/v1_0/channels'
  })
}
// 添加用户频道
// 用户推荐频道列表
export const addStatus = (data) => {
  // console.log(data)
  return servers({
    method: 'PUT',
    url: '/v1_0/user/channels',
    data: {
      channels: data
    }
  })
}
// 删除用户指定频道
export const removeStatus = (target) => {
  // console.log(data)
  return servers({
    method: 'DELETE',
    url: `/v1_0/user/channels/${target}`
  })
}
